<template>
    <div>
        <div class="body-content">
            <div class="content-main" v-if="detail">
                <div class="act-detail">
                    <div class="act-min-detail w">
                        <div class="detail-left">
                            <a href="javascript:;" class="types" target="_blank">&nbsp;{{detail.type == 1 ? '移民' : '集团'}}
                            </a>
                            <span class="time">{{detail.createTime.split(" ")[0]}}</span>
                            <!--<span class="zuozhe">婶</span>-->
                            <p class="tit">{{detail.title}}</p>
                            <div class="det" v-html="detail.content"></div>
                            <!--<img class="feng" :src="getImage(detail.coverImageUrl)" alt="" title='zixun.jpg' />-->
                        </div>
                    </div>
                </div>	
            </div>
        </div>
        <loading :loadingState="loadingState" />
    </div>
</template>
<script>
import loading from "@/components/loading.vue";
import httpApi from '@/api/index'
import { mapGetters } from 'vuex'
export default {
    data(){
        return{
            detail: null,
            loadingState: true
        }
    },
    created() {
        this.getDetail(this.$route.query.id);
    },
    methods: {
        getImage(url){
            return this.baseApi + url;
        },
        getDetail(id) {
            httpApi.getNewsDetail(id).then(res => {
                this.detail = res.data;
                this.loadingState = false;
            })
        },
    },
    components: {
        loading
    },
    computed: {
        ...mapGetters([ 'baseApi' ])
    },
}
</script>
<style lang="scss" scoped>
    @import "src/assets/css/project-index";
    @import "src/assets/css/article-detail";
</style>